{% comment %}
NOTE:  The form fields here are rendered with a 'prefix' variable, which defaults to nothing.  This is
so several OCR settings forms can be embedded in a given page without variable collisions.
{% endcomment %}

<div class="field_wrapper">            
    <label for="{{prefix}}form_engine">OCR Engine</label>
    <select id="{{prefix}}form_engine" name="${{prefix}}engine">
        {% for engine in engines %}
        <option value="{{engine}}">{{engine|capfirst}}</option>
        {% endfor %}
    </select>
</div>
<div class="field_wrapper">        
    <label for="{{prefix}}form_segmenter">Page Segmenter</label>
    <select id="{{prefix}}form_segmenter" name="${{prefix}}psegmenter">
        <option value="0" {% ifequal params.psegmenter 0 %}selected="selected"{% endifequal %}>
            Default
        </option>
        {% if segpresets %}
            {% for p in segpresets %}
                <option value="{{p.pk}}"                        
                    {% ifequal p.pk params.psegmenter %}
                        selected="selected"
                    {% endifequal %}
                >{{p.name}}</option>                        
            {% endfor %}            
        {% endif %}            
    </select>
</div>
<div class="field_wrapper">        
    <label for="{{prefix}}form_clean">Preprocessing</label>
    <select id="{{prefix}}form_clean" name="${{prefix}}clean">
        <option value="0" {% ifequal params.clean 0 %}selected="selected"{% endifequal %}>
            Default
        </option>
        {% if binpresets %}        
            {% for p in binpresets %}
                <option value="{{p.pk}}"
                    {% ifequal p.pk params.clean %}
                        selected="selected"
                    {% endifequal %}
                >{{p.name}}</option>                        
            {% endfor %}            
        {% endif %}            
    </select>
</div>
<div class="field_wrapper">        
    <label for="{{prefix}}form_cmodel">Character Model</label>
    <select id="{{prefix}}form_cmodel" name="${{prefix}}cmodel">
    </select>
</div>
<div class="field_wrapper">        
    <label for="{{prefix}}form_lmodel">Language Model</label>
    <select id="{{prefix}}form_lmodel" name="${{prefix}}lmodel">
    </select>
</div>

